/*
 * Copyright (C) 2012 Rothens
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied war                              anty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package rpg;

import java.io.File;
import java.util.logging.Logger;
import rpg.Maps.Map;
import rpg.entities.factories.SpriteFactory;
import rpg.gfx.light.LightSource;
import rpg.gfx.light.Lighting;

/**
 * rothens.tarhely.biz
 * @author Rothens
 */
public class Game {
	
	private Maps mapsys;
	private Map actual;
	
        private static Game instance = null;
        private Game() {}
        
	public static synchronized Game getInstance(){
            if(instance == null) {
                instance = new Game();
            }
            return instance;
	}
        
        public static void newInstance() {
            getInstance().setMapsys(new Maps());
	    SpriteFactory.clear();
	    instance.setActual(instance.getMapsys().loadBinaryMap("main"));
        }
        
	public void tick(){
		Events.Tick();
	}
        
        private static final Logger LOG = Logger.getLogger(Game.class.getName());

        /**
        * @return the mapsys
        */
        public Maps getMapsys() {
            return mapsys;
        }

        /**
        * @param mapsys the mapsys to set
        */
        public void setMapsys(Maps mapsys) {
            this.mapsys = mapsys;
        }

        /**
        * @return the actual
        */
        public Map getActual() {
            return actual;
        }

        /**
        * @param actual the actual to set
        */
        public void setActual(Map actual) {
            this.actual = actual;
        }	
}